package com.efesco.payroll.classItem;

import java.util.List;

import com.bstek.dorado.data.*;
import com.bstek.dorado.data.db.DBStatement;
import com.bstek.dorado.data.db.SqlDataset;
import com.bstek.dorado.utils.variant.VariantSet;
import com.bstek.dorado.common.*;
import com.efesco.common.FinalDefine;
import com.efesco.common.Tools;

/**
 * ClassItemView_datasetClassItemListener
 */
public class ClassItemView_datasetClassItemListener extends AbstractDatasetListener {
   public boolean beforeLoadData(Dataset dataset) throws Exception {		  
	      return true;
   }
   public void afterLoadData(Dataset dataset)throws Exception {	    
	    String productIds=dataset.getString("DATA_OF_CONTRACT");
		if(!"".equals(productIds)){
			String sql="select product_name from s_product where product_id in("+productIds+")";
			DBStatement statement = new DBStatement();
			statement.setSql(sql);
			List list=statement.queryForList();				
			statement.close();
			String productNames="";
			for(int i=0;i<list.size();i++){
				VariantSet var1=(VariantSet)list.get(i);
				productNames+=var1.getString(0);
				if(i<list.size()-1) productNames+=",";
			}
			dataset.setValue("DATA_OF_CONTRACT_NAME",productNames);
		}
		System.out.println("222222222222222222");
  }

}
